﻿using System;

namespace AutoCSer.CommandService.StreamPersistenceMemoryDatabase
{
    /// <summary>
    /// Server-side node method flags
    /// 服务端节点方法标记
    /// </summary>
    [Flags]
    public enum MethodFlagsEnum : byte
    {
        /// <summary>
        /// No flag
        /// 无标记
        /// </summary>
        None,
        /// <summary>
        /// Whether to persist (persistence is required if write operations are involved)
        /// 是否持久化（涉及写入操作则需要持久化）
        /// </summary>
        IsPersistence = 1,
        /// <summary>
        /// Whether the client is allowed to call it or not, otherwise it is a server memory call method
        /// 是否允许客户端调用，否则为服务端内存调用方法
        /// </summary>
        IsClientCall = 2,
        /// <summary>
        /// Whether to simply serialize the output data
        /// 是否简单序列化输出数据
        /// </summary>
        IsSimpleSerializeParamter = 4,
        /// <summary>
        /// Whether to simply deserialize the input data
        /// 是否简单反序列化输入数据
        /// </summary>
        IsSimpleDeserializeParamter = 8,
        /// <summary>
        /// Whether to simply serialize the output data of the first-stage callback of the two-stage callback
        /// 是否简单序列化二阶段回调的第一阶段回调输出数据
        /// </summary>
        IsSimpleSerializeTwoStageCallbackParamter = 0x10,
        /// <summary>
        /// Whether to ignore the persistence callback exception, the node method must ensure that the memory data state is restored when an exception occurs. It must be concerned about the memory shortage exception generated by new, and all new operations should be completed before modifying the data
        /// 是否忽略持久化回调异常，节点方法必须保证异常时还原恢复内存数据状态，必须关心 new 产生的内存不足异常，在修改数据以前应该将完成所有 new 操作
        /// </summary>
        IsIgnorePersistenceCallbackException = 0x20,
        /// <summary>
        /// Whether the local call is added to the write operation queue
        /// 本地调用是否添加到写操作队列
        /// </summary>
        IsWriteQueue = 0x80,
    }
}
